Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine MPO size from markers, not EXIF data #7884

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Mar 16, 2024

Resolves #7879

From my reading, Page 10 of the MPO specification shows that the APP1 marker should contain EXIF data. However, a user has found an image where it does not. This lead to an error when the not-EXIF data was treated as EXIF data, and an error when the size of the second frame wasn't read from the EXIF data.

This PR updates the code to use JpegImagePlugin's reading of markers. This allows for the possibility of APP1 markers without EXIF data, and reads the size from SOF-like markers instead of from EXIF data.

@radarhere radarhere marked this pull request as draft March 16, 2024 06:57
@radarhere radarhere changed the title Allow for MPO APP1 markers without EXIF data Determine MPO size from markers, not EXIF data Mar 16, 2024
@radarhere radarhere marked this pull request as ready for review March 16, 2024 07:47
@hugovk hugovk merged commit c2904b8 into python-pillow:main Mar 28, 2024
57 checks passed
@radarhere radarhere deleted the mpo branch March 28, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error opening jpeg file
2 participants